/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



/**
 *
 * @author dtuanh
 */
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class Server  {

    
    public static void main(String[] args) {
       // if (System.getSecurityManager() == null) {
          //  System.setSecurityManager(new SecurityManager());
        //}
        try {
            //exporter l'objet dictionnaire
            String name = "Dict";
            Dictionnary engine = new DictionnaryImpl();
            Dictionnary stub =
                (Dictionnary) UnicastRemoteObject.exportObject(engine, 0);
            Registry registry = LocateRegistry.getRegistry();
            registry.rebind(name, stub);
            System.out.println("Dictionnary bound");
        } catch (Exception e) {
            System.err.println("Dictionnary exception:");
            e.printStackTrace();
        }
    }
}
